home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Information / Digests / CSMP Digest / volume 3 / csmp-digest-v3-026 < prev    next >
Encoding:
Text File  |  1994-12-08  |  74.9 KB  |  1,876 lines  |  [TEXT/R*ch]

  1. Received-Date: Fri, 13 May 1994 00:30:51 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-026
  4. To: csmp-digest@ens.fr
  5. Date: Fri, 13 May 94 0:30:43 MET DST
  6. X-Mailer: ELM [version 2.3 PL11]
  7. Errors-To: listman@ens.fr
  8. Reply-To: pottier@clipper.ens.fr
  9. X-Sequence: 29
  10.  
  11. C.S.M.P. Digest             Thu, 12 May 94       Volume 3 : Issue 26
  12.  
  13. Today's Topics:
  14.  
  15.         Can I send Apple Event from Script Editor?
  16.         Disk Cache performance evaluation test software
  17.         Extension Shell 1.3 - Help for INIT writers
  18.         FFT benchmark using CodeWarrior
  19.         How do I find the window colour ???
  20.         Private inheritance faulty in SC++ 7.0
  21.         Source Control Questions
  22.         Using xlc to generate PowerMacintosh code
  23.  
  24.  
  25.  
  26. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  27. (pottier@clipper.ens.fr).
  28.  
  29. The digest is a collection of article threads from the internet newsgroup
  30. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  31. regularly and want an archive of the discussions.  If you don't know what a
  32. newsgroup is, you probably don't have access to it.  Ask your systems
  33. administrator(s) for details.  If you don't have access to news, you may
  34. still be able to post messages to the group by using a mail server like
  35. anon.penet.fi (mail help@anon.penet.fi for more information).
  36.  
  37. Each issue of the digest contains one or more sets of articles (called
  38. threads), with each set corresponding to a 'discussion' of a particular
  39. subject.  The articles are not edited; all articles included in this digest
  40. are in their original posted form (as received by our news server at
  41. nef.ens.fr).  Article threads are not added to the digest until the last
  42. article added to the thread is at least two weeks old (this is to ensure that
  43. the thread is dead before adding it to the digest).  Article threads that
  44. consist of only one message are generally not included in the digest.
  45.  
  46. The digest is officially distributed by two means, by email and ftp.
  47.  
  48. If you want to receive the digest by mail, send email to listserv@ens.fr
  49. with no subject and one of the following commands as body:
  50.     help                        Sends you a summary of commands
  51.     subscribe csmp-digest Your Name    Adds you to the mailing list
  52.     signoff csmp-digest            Removes you from the list
  53. Once you have subscribed, you will automatically receive each new
  54. issue as it is created.
  55.  
  56. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  57. Questions related to the ftp site should be directed to
  58. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  59. digest are available there.
  60.  
  61. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.
  62.  
  63.  
  64. -------------------------------------------------------
  65.  
  66. >From RTY868@email.nml.mot.com (Masaaki Iwasa)
  67. Subject: Can I send Apple Event from Script Editor?
  68. Date: Wed, 27 Apr 1994 09:03:56 GMT
  69. Organization: Nippon Motorola Limited,  Tokyo  Japan
  70.  
  71. Dose someone know if an Apple Event can be sent from within Script Editor
  72. to an Apple Event aware but not Apple Scriptable program?
  73.  
  74. I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  75. know I can send them from HyperCard.
  76.  
  77. No way??
  78.  
  79. -- 
  80. Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  81. Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  82.  
  83. +++++++++++++++++++++++++++
  84.  
  85. >From jwbaxter@olympus.net (John W. Baxter)
  86. Date: Thu, 28 Apr 1994 07:28:26 -0700
  87. Organization: Internet for the Olympic Peninsula
  88.  
  89. In article <RTY868-270494180057@180.3.150.33>, RTY868@email.nml.mot.com
  90. (Masaaki Iwasa) wrote:
  91.  
  92. > Dose someone know if an Apple Event can be sent from within Script Editor
  93. > to an Apple Event aware but not Apple Scriptable program?
  94. > I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  95. > know I can send them from HyperCard.
  96.  
  97. You can send arbitrary Apple events to any application which has the proper
  98. bit set to say it accepts high level events.
  99.  
  100. The syntax in AppleScript for doing so is rather ugly...if you have Think
  101. Project Manager 6 (or, likely 7, but I'm not sure of that), try turning
  102. recording on in the Script Editor, then going into Think Project Manager
  103. and changing the option regarding the generation of MacsBug symbols.  That
  104. should record as a generic event, and give you an idea of the syntax.
  105.  
  106. UserLand Frontier provides a somewhat clearer syntax for sending such
  107. events...in either scripting system, you can of course write subroutines
  108. which hide the gory mess from the rest of your code.
  109.  
  110. -- 
  111. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  112.    jwbaxter@pt.olympus.net
  113.  
  114. +++++++++++++++++++++++++++
  115.  
  116. >From isis@netcom.com (Mike Cohen)
  117. Date: Thu, 28 Apr 1994 18:29:22 GMT
  118. Organization: ISIS International
  119.  
  120. RTY868@email.nml.mot.com (Masaaki Iwasa) writes:
  121.  
  122. >Dose someone know if an Apple Event can be sent from within Script Editor
  123. >to an Apple Event aware but not Apple Scriptable program?
  124.  
  125. >I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  126. >know I can send them from HyperCard.
  127.  
  128. >No way??
  129.  
  130. >-- 
  131. >Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  132. >Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  133.  
  134. you can send any event using something like:
  135.  tell application "foo" to <<event XXXXYYYY>> directobject given
  136.     <<class ZZZZ>> someotherparam
  137.  
  138. Note that the << and >> should really be opt-backslash & shift-opt-backslash.
  139. -- 
  140. Mike Cohen - isis@netcom.com
  141. NewtonMail, eWorld: MikeC / ALink: D6734 / AOL: MikeC20
  142.  
  143. +++++++++++++++++++++++++++
  144.  
  145. >From paul@ctalk.exnet.com (Paul G Smith)
  146. Date: Thu, 28 Apr 94 21:45:33 GMT
  147. Organization: commstalk, & Full Moon Software Inc
  148.  
  149.  
  150. In article <isisCozFCy.JAM@netcom.com> (comp.sys.mac.programmer), isis@netcom.com (Mike Cohen) writes:
  151. > >Dose someone know if an Apple Event can be sent from within Script Editor
  152. > >to an Apple Event aware but not Apple Scriptable program?
  153. > >I want to send Apple events to Microsoft Project 3.0 from Script Editor. I
  154. > >know I can send them from HyperCard.
  155. > >No way??
  156. > >-- 
  157. > >Masaaki Iwasa                    LMPS, Nippon Motorola Limited
  158. > >Email: RTY868@email.nml.mot.com   /  MHA01341@niftyserve.or.jp
  159. > you can send any event using something like:
  160. >  tell application "foo" to <<event XXXXYYYY>> directobject given
  161. >     <<class ZZZZ>> someotherparam
  162.  
  163. There is another way to do this... not guaranteed to be the best solution
  164. for your needs, but it will make for easier scripting:
  165.  
  166. Why not create an 'aete' resource for Microsoft Project? It's not
  167. a trivial task, admittedly, but it's not all that hard (especially
  168. if you take one from another app to use as a starting point). There
  169. is a template for ResEdit for editing aete resources. When you have
  170. done this, and given a human-readable terminology to the apple events,
  171. you'll find it _very_ easy to script them from the Script Editor.
  172.  
  173.  
  174. best regards, Paul
  175.  
  176. - --------------------------------------------------------------
  177. Paul G Smith, Commstalk HQ          ||  UK ph: +44 727 844232
  178. P O Box 116, ST ALBANS              ||    fax: +44 727 856139
  179. Hertfordshire. AL1 2RL. UK          ||  US ph: 408 253 7199
  180. & Full Moon Software, Inc           ||    fax: 408 252 2378
  181. P O Box 700237, SAN JOSE, CA 95170  ||  AppleLink: COMMSTALK.HQ 
  182.  
  183. ---------------------------
  184.  
  185. >From Stuart Cheshire <cheshire@cs.stanford.edu>
  186. Subject: Disk Cache performance evaluation test software
  187. Date: 9 Apr 1994 17:38:54 GMT
  188. Organization: Stanford University
  189.  
  190. The test program writes 512K to disk, using various block sizes, from 1024
  191. FSWrite calls of 512 bytes each to 32 FSWrite of 16K each.
  192.  
  193. Each test is done three ways, firstly with simple FSWrite, then with FSWrite
  194. alternating with PBFlushFile, and then with FSWriteNoCache.
  195.  
  196. The first is what you might naively write in a program which is trying to run
  197. cooperatively in the background while transferring a file to disk. It results
  198. in all the writes going to the cache, and then the Mac freezes solid for ten
  199. seconds when the file is closed.
  200.  
  201. The second is an attempt to fix this by flushing the file to disk after every
  202. write. It achieves the goal of spreading the delay over all the writes,
  203. instead of having a big freeze at the end, but it still takes over 10 seconds.
  204.  
  205. The third method was pointed out to me by Jim Matthews (author of Fetch). It
  206. uses the little known (but supported -- see IM:Files, page 89) non-caching
  207. option of PBWrite.
  208. Similarly, this achieves the goal of spreading the delay over all the writes,
  209. but it also makes it go up to 25 times faster.
  210.  
  211. Results:
  212.  
  213. Tests were performed with a Macintosh Quadra 700, System 7.0.1/Tuneup 1.1.1,
  214. 768KB disk cache, 32 bit addressing, no virtual memory, 20MB RAM:
  215.  
  216. Testing Writing 512K in various block sizes
  217. Testing 0.5K blocks
  218. Standard writes:    Write:  39 (! 0s)  Close: 691 (!11s)  Total: 730 (!12s)
  219. Write and flush:    Write: 689 (!11s)  Close:   1 (! 0s)  Total: 690 (!11s)
  220. No-cache writes:    Write: 689 (!11s)  Close:   1 (! 0s)  Total: 690 (!11s)
  221. Testing   1K blocks
  222. Standard writes:    Write:  26 (! 0s)  Close: 691 (!11s)  Total: 717 (!11s)
  223. Write and flush:    Write: 691 (!11s)  Close:   1 (! 0s)  Total: 692 (!11s)
  224. No-cache writes:    Write: 346 (! 5s)  Close:   0 (! 0s)  Total: 346 (! 5s)
  225. Testing   2K blocks
  226. Standard writes:    Write:  23 (! 0s)  Close: 692 (!11s)  Total: 715 (!11s)
  227. Write and flush:    Write: 691 (!11s)  Close:   0 (! 0s)  Total: 691 (!11s)
  228. No-cache writes:    Write:  85 (! 1s)  Close:   0 (! 0s)  Total:  85 (! 1s)
  229. Testing   4K blocks
  230. Standard writes:    Write:  21 (! 0s)  Close: 692 (!11s)  Total: 713 (!11s)
  231. Write and flush:    Write: 691 (!11s)  Close:   1 (! 0s)  Total: 692 (!11s)
  232. No-cache writes:    Write:  51 (! 0s)  Close:   0 (! 0s)  Total:  51 (! 0s)
  233. Testing   8K blocks
  234. Standard writes:    Write:  21 (! 0s)  Close: 691 (!11s)  Total: 712 (!11s)
  235. Write and flush:    Write: 690 (!11s)  Close:   1 (! 0s)  Total: 691 (!11s)
  236. No-cache writes:    Write:  39 (! 0s)  Close:   0 (! 0s)  Total:  39 (! 0s)
  237. Testing  16K blocks
  238. Standard writes:    Write:  17 (! 0s)  Close: 692 (!11s)  Total: 709 (!11s)
  239. Write and flush:    Write: 694 (!11s)  Close:   0 (! 0s)  Total: 694 (!11s)
  240. No-cache writes:    Write:  26 (! 0s)  Close:   1 (! 0s)  Total:  27 (! 0s)
  241.  
  242. Notice that:
  243.  
  244. 1. With the simple writes, every block size, even 16K, incurs a Mac-crippling
  245. ten second freeze when the file is closed.
  246.  
  247. 2. Using write and flush takes the same time as simple writes, but spread
  248. over all the Write calls instead of in a single big freeze at the end.
  249.  
  250. 3. In BOTH of the above cases, it takes at best 691 ticks to write 512K,
  251. making a data rate of 44.5K/sec.
  252.  
  253. 4. Using No-cache writes incurs no freeze for the close call, and if you are
  254. writing 4K blocks it achieves 602K/sec, more than ten times faster than the
  255. simple writes. If you are prepared to go to 16K blocks, it exceeds a
  256. megabyte per second -- more than 25 times faster than simple writes with
  257. the same block size.
  258.  
  259. If anyone wishes to run the test program and give me results for other
  260. configurations, why not post those results here.
  261.  
  262. Stuart Cheshire <cheshire@cs.stanford.edu>
  263.  * <A HREF="file://brubeck.stanford.edu/www/cheshire-bio.html">WWW</A>
  264.  * Stanford Distributed Systems Group Research Assistant
  265.  * Escondido Village Resident Computer Coordinator
  266.  * Macintosh Programmer
  267. >From Stuart Cheshire <cheshire@cs.stanford.edu>
  268. Subject: Disk Cache performance evaluation test software
  269. Date: 9 Apr 1994 18:48:06 GMT
  270. Organization: Stanford University
  271.  
  272. // Copyright (C) 23rd November 1993
  273. // Stuart Cheshire <cheshire@cs.stanford.edu>
  274.  
  275. #include <stdio.h>
  276. #include <stdlib.h>
  277.  
  278. #define FILE_SIZE      0x80000
  279. #define MAX_BLOCK_SIZE 0x4000
  280. static char *buffer;
  281. static SysEnvRec sysenvirons;
  282. static const unsigned char filename[] = "\pFlusherTestFile";
  283. static IOParam fileflusher;
  284.  
  285. static OSErr FSWriteNoCache(short refnum, long *count_p, const Ptr buffer_p)
  286.     {
  287.     OSErr retcode;
  288.     ParamBlockRec pb;
  289.     pb.ioParam.ioCompletion = 0;
  290.     pb.ioParam.ioRefNum     = refnum;
  291.     pb.ioParam.ioBuffer     = buffer_p;
  292.     pb.ioParam.ioReqCount   = *count_p;
  293.     pb.ioParam.ioPosMode    = fsAtMark | 0x20; /* don't cache */
  294.     pb.ioParam.ioPosOffset  = 0;
  295.     retcode = PBWrite(&pb, false);
  296.     *count_p = pb.ioParam.ioActCount;
  297.     return(retcode);
  298.     }
  299.  
  300. static void filetest(unsigned long block_size, short testcase)
  301.     {
  302.     long inOutCount, t1, t2, t3;
  303.     short fRefNum, i, num_blocks = FILE_SIZE / block_size;
  304.     FSDelete(filename, sysenvirons.sysVRefNum);
  305.     if (Create(filename, sysenvirons.sysVRefNum, '????', '????'))
  306.         { printf("Create failed\n"); exit(1); }
  307.     if (FSOpen(filename, sysenvirons.sysVRefNum, &fRefNum))
  308.         { printf("FSOpen failed\n"); exit(1); }
  309.     fileflusher.ioCompletion = NULL;
  310.     fileflusher.ioResult     = noErr;
  311.     fileflusher.ioRefNum     = fRefNum;
  312.     t1 = TickCount();
  313.     for (i=0; i<num_blocks; i++)
  314.         {
  315.         inOutCount = block_size;
  316.         switch (testcase)
  317.             {
  318.             case 0: FSWrite(fRefNum, &inOutCount, buffer);
  319.                     break;
  320.             case 1: FSWrite(fRefNum, &inOutCount, buffer);
  321.                     if (fileflusher.ioResult == noErr)
  322.                         PBFlushFile((ParmBlkPtr)&fileflusher, TRUE);
  323.                     break;
  324.             case 2: FSWriteNoCache(fRefNum, &inOutCount, buffer);
  325.                     break;
  326.             }
  327.         }
  328.     t2 = TickCount();
  329.     if (FSClose(fRefNum)) { printf("FSClose failed\n"); exit(1); }
  330.     t3 = TickCount();
  331.     FSDelete(filename, sysenvirons.sysVRefNum);
  332.     printf("Write:%4ld (!%2lds)  ", t2-t1, (t2-t1)/60);
  333.     printf("Close:%4ld (!%2lds)  ", t3-t2, (t3-t2)/60);
  334.     printf("Total:%4ld (!%2lds)\n", t3-t1, (t3-t1)/60);
  335.     }
  336.  
  337. static void blocktest(unsigned long block_size)
  338.     {
  339.     printf("Standard writes:    "); filetest(block_size, 0);
  340.     printf("Write and flush:    "); filetest(block_size, 1);
  341.     printf("No-cache writes:    "); filetest(block_size, 2);
  342.     }
  343.  
  344. void main(void)
  345.     {
  346.     buffer = NewPtr(MAX_BLOCK_SIZE);
  347.     if (!buffer) { printf("Not enough memory\n"); exit(1); }
  348.     SysEnvirons(curSysEnvVers, &sysenvirons);
  349.     printf("Testing Writing %ldK in various block sizes\n", FILE_SIZE / 1024);
  350.     printf("Testing 0.5K blocks\n"); blocktest( 0x200);
  351.     printf("Testing   1K blocks\n"); blocktest( 0x400);
  352.     printf("Testing   2K blocks\n"); blocktest( 0x800);
  353.     printf("Testing   4K blocks\n"); blocktest(0x1000);
  354.     printf("Testing   8K blocks\n"); blocktest(0x2000);
  355.     printf("Testing  16K blocks\n"); blocktest(0x4000);
  356.     }
  357.  
  358.  
  359. Stuart Cheshire <cheshire@cs.stanford.edu>
  360.  * <A HREF="file://brubeck.stanford.edu/www/cheshire-bio.html">WWW</A>
  361.  * Stanford Distributed Systems Group Research Assistant
  362.  * Escondido Village Resident Computer Coordinator
  363.  * Macintosh Programmer
  364.  
  365. +++++++++++++++++++++++++++
  366.  
  367. >From qsi@cnh.wlink.nl (Peter Kocourek)
  368. Date: Sun, 10 Apr 1994 15:45:39 +0100
  369. Organization: (none)
  370.  
  371. Stuart Cheshire wrote in a message on 09 Apr 94
  372.  
  373. [... test results deleted]
  374.  
  375.  SC> Notice that: 
  376.  SC> 1. With the simple writes, every block size, even 16K, incurs 
  377.  SC> a Mac-crippling ten second freeze when the file is closed. 
  378.  
  379. Actually, this depends on the size of the cache; the smaller the cache, the
  380. sooner you'll get decent performance with increasing block size. Once a certain
  381. threshold is passed (in terms of blocksize vs. cachesize), the performance will
  382. improve enormously. Unfortunately, even with just a 32K cache, you need a
  383. fairly large blocksize (I forget the exact figures). I have run similar tests
  384. with a port of the Unix iozone program, which benchmarks file system
  385. performance, and that's how I discovered the rather useless nature of the
  386. cache. I did not know about the no-cache bit, though...
  387.  
  388.  
  389. YHS:QSI!
  390.  
  391.  
  392. +++++++++++++++++++++++++++
  393.  
  394. >From whbenson@lbl.gov (Bill Benson)
  395. Date: Tue, 12 Apr 1994 15:13:52 -0800
  396. Organization: Lawrence Berkeley Lab
  397.  
  398. Does anyone know if there would be any (significant) performance gain from
  399. disabling the cache while reading? (as opposed to writing)
  400. -Bill Benson, Lawrence Berkeley Lab, whbenson@lbl.gov
  401.  
  402. +++++++++++++++++++++++++++
  403.  
  404. >From Alan_B._Harper@bmug.org (Alan B. Harper)
  405. Date: Tue, 12 Apr 94 02:04:15 PST
  406. Organization: Berkeley Macintosh Users Group
  407.  
  408. There was an interesting note by Mike Scanlin in MacTech magazine (April 1993,
  409. p. 75)
  410. about the Apple disk cache.  I can't quote the entire article, but a relevant
  411. section is
  412.  
  413. > The formula [Apple] uses to decide if any given read or write should
  414. > be cached is:
  415. >   numCacheBlocks = user-defined cache size DIV 512;
  416. >   maxCachedReadWrite = (numCacheBlocks - 1) * 16;
  417. > So with a cache size of 256K you get
  418. >     numCacheBlocks = 512;
  419. >   maxCachedReadWrite = 8176
  420. > That means that any read/write larger than 8176 bytes will not be cached.  So
  421. in
  422. > my test app [described in the article], nothing was being cached until the
  423. cache
  424. > was 384K or larger, at which time my 8K writes were being cached (and I got
  425. > a 13x performance slow-down).
  426.  
  427. Basically, this means that if your app either does its own caching, or if it
  428. writes something it knows it won't need again, always set the no-cache bit.
  429.  
  430. +++++++++++++++++++++++++++
  431.  
  432. >From peter.lewis@info.curtin.edu.au (Peter N Lewis)
  433. Date: Thu, 14 Apr 1994 16:08:37 +0800
  434. Organization: NCRPDA, Curtin University
  435.  
  436. In article <0013A0ED.fc@bmug.org>, Alan_B._Harper@bmug.org (Alan B.
  437. Harper) wrote:
  438.  
  439. >Basically, this means that if your app either does its own caching, or if it
  440. >writes something it knows it won't need again, always set the no-cache bit.
  441.  
  442. Not entirely.  Even if you know it will be read again, it is often better
  443. to disable the cache.  For example, I get better performance out of
  444. Anarchie downloading files and then feeding them to StuffIt Expander if
  445. the cache is inhibited during the download even though I know Expander
  446. will read the file as soon as I'm finished.
  447.  
  448. Basically, disable the cahce unless you are writing 10 byte blocks, and
  449. *DONT* write ten byte blocks!  If you write lots of small blocks, the
  450. FSClose time goes exponential, at least in tests I did.  Writing a 1 Meg
  451. file could end up with close times measured in minutes.
  452.    Peter.
  453. _______________________________________________________________________
  454. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  455.  
  456. +++++++++++++++++++++++++++
  457.  
  458. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  459. Date: 16 Apr 1994 17:03:25 GMT
  460. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  461.  
  462. In article <whbenson-120494151352@twinpeaks.lbl.gov> whbenson@lbl.gov (Bill Benson) writes:
  463. >
  464. > Does anyone know if there would be any (significant) performance gain from
  465. > disabling the cache while reading? (as opposed to writing)
  466.  
  467. the simple answer is that you aren't likely to see any performance gain, and
  468. (and if do this indiscriminantly) you'll make things much worse.
  469.  
  470. when you read a chunk from the disk, if it's not in the cache, the disk
  471. _must_ be accessed.  there's no way around this, and disk accesses are
  472. slow.
  473.  
  474. of course, if the data is in the cache, then the read is quite fast.  this
  475. is the basic idea of caches - keep useful data in the cache to avoid
  476. having to access the disk.
  477.  
  478. knowing what data is going to be useful is difficult, but a few rules of
  479. thumb have proved useful:
  480.   if it was accessed recently, it is likely to be accessed again soon
  481.   if an area was accessed, the surrounding area is likely to be accessed
  482.     in the near future
  483.  
  484. thus, whenever you access the disk, cache it somewhere because you're likely
  485. to need it again. and grab a little bit more than you need, because you're
  486. likely to need that, too.
  487.  
  488. turning off the caches effectively disables this optimization.  the only
  489. time it may be useful is if you know _absolutely_ that you'll never need
  490. it again.  even then, you probably won't notice the speed benefit (since
  491. the disk access is the most significant part, and you can't avoid that).
  492.  
  493. if you load something into the cache that isn't used, it'll eventually
  494. get swapped out for useful data. it's usually not worth worrying about.
  495.  
  496.  
  497. WRT writes, turning off the cache can be useful because it _does_ "eliminate"
  498. the disk access by deferring it until later.
  499.  
  500.  
  501. hope this clears things up,
  502.  
  503.  
  504. -gary j kacmarcik
  505. platypus@cirrus.som.cwru.edu
  506.  
  507. +++++++++++++++++++++++++++
  508.  
  509. >From Cameron Esfahani <dirty@guest.apple.com>
  510. Date: Sun, 17 Apr 1994 09:20:34 GMT
  511. Organization: Apple Computer, Inc.
  512.  
  513. In article <PLATYPUS.94Apr16130325@cirrus.som.cwru.edu> Gary Kacmarcik,
  514. platypus@cirrus.som.cwru.edu writes:
  515. > knowing what data is going to be useful is difficult, but a few rules of
  516. > thumb have proved useful:
  517. >   if it was accessed recently, it is likely to be accessed again soon
  518. >   if an area was accessed, the surrounding area is likely to be accessed
  519. >     in the near future
  520. > thus, whenever you access the disk, cache it somewhere because you're likely
  521. > to need it again. and grab a little bit more than you need, because you're
  522. > likely to need that, too.
  523. > if you load something into the cache that isn't used, it'll eventually
  524. > get swapped out for useful data. it's usually not worth worrying about.
  525.  
  526. One problem with this is that you have to get the space in the
  527. cache from someplace!  Then you have to decide what information to
  528. throw out, just so you can read ih the
  529. AppleShare 3.0.x, Macintosh File Sharing and AppleShare 2.0 file servers, the
  530. server reads everything in 4K chunks and writes everything in 4K chunks, no
  531. matter how large the requests were on the client side.
  532.  
  533. AppleShare Pro and AppleShare 4.0 improve performance dramatically by caching
  534. data on the server.  For example, if an 8K read request is received from a
  535. client, the server reads 8K into its cache and returns 4K (because of the ATP
  536. limitation).  When the AFP client asks for the remaining 4K, the server gets it
  537. from its cache which saves a hit to the disk.
  538.  
  539. So, with file access to an AppleShare volume:
  540.  
  541. o  The noCache bit in your Reads and Writes makes no difference whatsoever.
  542.  
  543. o  Using large Read and Writes from the client will improve performance -
  544. especially with AppleShare Pro and AppleShare 4.0.
  545.  
  546. -- Jim Luther
  547.  
  548.  
  549. ---------------------------
  550.  
  551. >From grantd@dcs.gla.ac.uk (Dair Grant)
  552. Subject: Extension Shell 1.3 - Help for INIT writers
  553. Date: Wed, 27 Apr 1994 16:45:51 GMT
  554. Organization: Computing Science Dept., Glasgow University, Glasgow, Scotland
  555.  
  556. Extension Shell is a library of source code for writing System 7
  557. Extensions. Full source code is provided, as well as six sample
  558. Extensions demonstrating how to write Extensions with Extension
  559. Shell.
  560.  
  561.  
  562. Extension Shell acts as an Extension-independent loading mechanism.
  563. It takes care of the generic stuff needed by all Extensions (showing
  564. icons, installing things into the System Heap, posting Notification
  565. Manager messages), and reduces the amount of coding needed to produce
  566. new Extensions.
  567.  
  568.  
  569. To write an Extension with Extension Shell, you just decide what you
  570. want installed, compile it into a code resource, and paste in
  571. Extension Shell. Trap patches, VBL tasks, Shutdown tasks, Time
  572. Manager tasks, Gestalt selectors, low-memory filters (e.g., jGNEFilter),
  573. and blocks of code can all be installed through a simple
  574. "fill out the details in a table" mechanism. It requires THINK C 6.0.
  575.  
  576.  
  577.  
  578. -dair
  579.  
  580. - -------------------+--------------------------------------------------------
  581. Dair Grant           | There are two major products that come out of Berkeley:
  582. grantd@dcs.gla.ac.uk | LSD and Unix. We don't believe this to be a
  583. Finger for PGP Key   | coincidence.                          - Jeremy Anderson
  584. - -------------------+--------------------------------------------------------
  585.  
  586. +++++++++++++++++++++++++++
  587.  
  588. >From grantd@dcs.gla.ac.uk (Dair Grant)
  589. Date: Wed, 27 Apr 1994 17:30:24 GMT
  590. Organization: Computing Science Dept., Glasgow University, Glasgow, Scotland
  591.  
  592. grantd@dcs.gla.ac.uk (Dair Grant) writes:
  593.  
  594. >Extension Shell is a library of source code for writing System 7
  595. >Extensions. Full source code is provided, as well as six sample
  596. >Extensions demonstrating how to write Extensions with Extension
  597. >Shell.
  598.  
  599.     [munch]
  600.  
  601.  
  602. Ooops. I forgot to mention that I've sent it off to macgifts. It
  603. should be showing up there within a couple of days. Too many
  604. late nights trying to get my final year project finished... :-(
  605.  
  606.  
  607.  
  608. -dair
  609.  
  610. - -------------------+--------------------------------------------------------
  611. Dair Grant           | There are two major products that come out of Berkeley:
  612. grantd@dcs.gla.ac.uk | LSD and Unix. We don't believe this to be a
  613. Finger for PGP Key   | coincidence.                          - Jeremy Anderson
  614. - -------------------+--------------------------------------------------------
  615.  
  616. ---------------------------
  617.  
  618. >From andys@nsrvan.van.wa.us
  619. Subject: FFT benchmark using CodeWarrior
  620. Date: 26 Apr 94 08:58:24 PST
  621. Organization: National Systems & Research, Vancouver WA
  622.  
  623. I ran the FFT benchmark which was posted to comp.sys.powerpc by
  624. whitney@galileo.Meakins.McGill.CA. I ran this on several computers
  625. including a PowerMac 6100/60. I compiled the program using 
  626. CodeWarrior DR2 which uses the Apple math library. I also am 
  627. including the SpecInt and SpecFP results which gsnow@clark.edu
  628. posted earlier:
  629.  
  630. these FFT results are from whitney@galileo.Meakins.McGill.CA:
  631.  
  632.                                   FFT Time     SpecInt   SpecFP
  633.  
  634.     RS6000 Model 320                 55.0       20.9      39.4
  635.     RS6000 Model 530                 41.0       28.5      64.6
  636.     RS6000 Model 250                 40.0       62.6      72.2
  637.     RS6000 Model 590                 18.0      117.0     242.4
  638.  
  639. These are the results from the tests I ran. Notice I ran with
  640. and without the compilers optimizer turned on:
  641.  
  642.     RS6000 Model 550 (Opt)           25.0       35.4      71.7
  643.     RS6000 Model 550 (No-Opt)        61.0       35.4      71.7
  644.     Decstation 5000/260 (Opt)        46.0       57.1      54.5
  645.     Decstation 5000/260 (No-Opt)     56.0       57.1      54.5
  646.     Decstation 5000/240 (Opt)        99.0       27.9      35.8
  647.     Dec3000 Alpha 300L (OVMS-Opt)    54.0       45.9      63.6
  648.     Dec3000 Alpha 300L (OVMS-NoOpt) 125.0       45.9      63.6
  649.     Dec3100/90 (VMS No-Opt)         133.0       ????      ????
  650.     Dec3100/90 (VMS Opt)            108.0       ????      ????
  651.     
  652.     PowerMac 6100/60 (No-Opt)        66.0      ~55.0     ~73.0
  653.     PowerMac 6100/60 (Opt)           65.0      ~55.0     ~73.0
  654.     PowerMac 6100/60 (Opt/double_t)  77.0      ~55.0     ~73.0
  655.  
  656. I think this is very interesting because it tells me that the
  657. CodeWarrior optimizer has a LONG way to go. Notice what the
  658. RS6000 Model 550 did using xlc with and without the optimizer.
  659. The optimizer gave a 244% speedup. The PowerMac with no optimization
  660. did almost as well as the RS6000 Model 550 without optimization.
  661. I think we have a lot to look forward to as CodeWarrior progesses!!
  662.  
  663. Another note, the FFT program uses floats, I tried to change these
  664. floats to double_t and the time came out to 77.0 with the optimizer
  665. turned on. I also tried changing the struct alignment just for
  666. the heck of it and all three settings [PowerPC, 68k, 68k 4-byte]
  667. all came out with the same times.
  668.  
  669. One more note, when I say optimizations above I meant I turned on
  670. the highest level of optimization each compiler has.
  671.  
  672.  
  673. +++++++++++++++++++++++++++
  674.  
  675. >From usenet@lowry.eche.ualberta.ca (Brian Lowry)
  676. Date: 26 Apr 1994 22:39:43 GMT
  677. Organization: Chem Eng - Univ of Alberta
  678.  
  679. In article <1994Apr26.085824.223@nsrvan.van.wa.us>, andys@nsrvan.van.wa.us
  680. wrote:
  681.  
  682. > I think this is very interesting because it tells me that the
  683. > CodeWarrior optimizer has a LONG way to go.
  684.  
  685.   I was under the impression that the DR2 CodeWarrior C compiler did not
  686. actually have optimization implemented, regardless of the project settings.
  687.  You might want to contact MetroWerks and ask them.  I haven't seen any
  688. evidence of optimization in low-level stuff...
  689.  
  690. -- 
  691.  
  692. Brian Lowry
  693.  
  694. +++++++++++++++++++++++++++
  695.  
  696. >From ameline@provence.torolab.ibm.com (Ian R. Ameline)
  697. Date: 27 Apr 1994 00:09:05 GMT
  698. Organization: C-Set++ Development, IBM Canada Laboratory.
  699.  
  700. In <1994Apr26.085824.223@nsrvan.van.wa.us>, andys@nsrvan.van.wa.us writes:
  701.  
  702. [Performance Numbers deleted]
  703.  
  704. >I think this is very interesting because it tells me that the
  705. >CodeWarrior optimizer has a LONG way to go. Notice what the
  706. >RS6000 Model 550 did using xlc with and without the optimizer.
  707.  
  708.    Well, IBM has been writing optimizing compilers for over 20 years. 
  709. I believe the current XLC optimizer has been in development for around 
  710. 10 years, with some really bright people involved with it. There 
  711. should be little surprise that we're good at this sort of thing.
  712.                                                                                   
  713. >The optimizer gave a 244% speedup. The PowerMac with no optimization
  714. >did almost as well as the RS6000 Model 550 without optimization.
  715. >I think we have a lot to look forward to as CodeWarrior progesses!!
  716.  
  717.    I've heard an unconfirmed rumour on the net that they've licenced 
  718. some IBM optimization technology. I don't know if it's true or not, 
  719. but if it is, perhaps your last sentence is correct.
  720.  
  721. Regards,                  | "Once you have flown, you will walk the earth with
  722. Ian R. Ameline, PP-ASEL   |  your eyes turned skyward, for there you have been,
  723. (speaking for myself only)|  and there you long to return" -- Leonardo DaVinci
  724. ViaCrypt PGP Key fingerprint = 3B B8 CF E9 CA 1B 9C 75  01 7F B2 64 10 7F 96 85   
  725.  
  726.  
  727. +++++++++++++++++++++++++++
  728.  
  729. >From Tigger <greg@pomona.claremont.edu>
  730. Date: Tue, 26 Apr 1994 03:45:25 GMT
  731. Organization: Pomona College
  732.  
  733. In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  734. ameline@provence.torolab.ibm.com writes:
  735. >
  736. >    I've heard an unconfirmed rumour on the net that they've licenced 
  737. > some IBM optimization technology.
  738.  
  739. I read it in at least two different trade rags, and it was reported
  740. as news, not rumors.  I believe one of the articles included quotes
  741. from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  742.  
  743. --
  744. |  Greg Orman                         greg@pomona.claremont.edu  |
  745. |     A man's best friends:  a Harley, a Beretta and a Gund.     |
  746.  
  747. +++++++++++++++++++++++++++
  748.  
  749. >From johnmce@world.std.com (John McEnerney)
  750. Date: Wed, 27 Apr 1994 15:54:38 GMT
  751. Organization: The World Public Access UNIX, Brookline, MA
  752.  
  753. >Another note, the FFT program uses floats, I tried to change these
  754. >floats to double_t and the time came out to 77.0 with the optimizer
  755. >turned on.
  756.  
  757. On the PowerPC, 'float' is usually faster than 'double', particularly 
  758. with multiply/divide instructions.
  759.  
  760. >The PowerMac with no optimization
  761. >did almost as well as the RS6000 Model 550 without optimization.
  762.  
  763. This is definitely attributable to the 550 being faster. When 
  764. optimizations are turned off, CodeWarrior handily outperforms xlc (xlc 
  765. makes little use of registers when optimization is turned off)
  766.  
  767. >I think we have a lot to look forward to as CodeWarrior progesses!!
  768.  
  769. The current version so CodeWarrior actually do almost no optimization 
  770. beyond global register allocation. This can make some programs faster, 
  771. but because of the plentiful registers on the PowerPC it does not make an 
  772. improvement in many cases. Future versions wil include all of 
  773. the usual optimizations.
  774.  
  775. -- John
  776.  
  777.  
  778. +++++++++++++++++++++++++++
  779.  
  780. >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik)
  781. Date: 27 Apr 1994 19:48:49 GMT
  782. Organization: Case Western Reserve University, Cleveland, Ohio (USA)
  783.  
  784. In article <A9E32DE57E0104A7@taz.claremont.edu> Tigger <greg@pomona.claremont.edu> writes:
  785. >
  786. > In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  787. > ameline@provence.torolab.ibm.com writes:
  788. > >
  789. > >    I've heard an unconfirmed rumour on the net that they've licenced 
  790. > > some IBM optimization technology.
  791. >
  792. > I read it in at least two different trade rags, and it was reported
  793. > as news, not rumors.  I believe one of the articles included quotes
  794. > from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  795.  
  796. John McEnerey (from Metrowerks) attempted to clarify the articles that
  797. were published.  these articles implied that Metrowerks has licensed
  798. some of IBM's code.  this is not the case.
  799.  
  800. included is an excerpt from John's original post.
  801.  
  802. -gary
  803.  
  804.  
  805. [QUOTED MESSAGE FOLLOWS]
  806.  
  807. Newsgroups: comp.sys.mac.programmer
  808. Path: usenet.ins.cwru.edu!eff!news.kei.com!world!johnmce
  809. From: johnmce@world.std.com (John McEnerney)
  810. Subject: Re: Metrowerks News from MacWEEK
  811. Message-ID: <CnzIH7.FoC@world.std.com>
  812. Organization: The World Public Access UNIX, Brookline, MA
  813. References: <Cnz0JL.5v9@zcias2.ziff.com> <9404090108.AA09272@geweke.ppp.msu.edu>
  814. Date: Sat, 9 Apr 1994 09:03:06 GMT
  815. Lines: 44
  816.  
  817. > Metrowerks has formed an agreement with IBM which gives Metrowerks 
  818. > access to Big Blue's compiler optimization technology for current and 
  819. > future PowerPC processors. As a result, Mac developers will have access 
  820. > to the best PowerPC code generators available, said Jean Belanger, 
  821. > Metrowerks' chairman. "In addition to having the fastest compiler, we'
  822. > ll be able to generate the fastest code," he said. 
  823.  
  824. So that the rumours don't fly to far too fast on this one, let me clarify 
  825. the situation as it will affect you, the users.
  826.  
  827. We have an agreement which says that as I develop the next version 
  828. of our PowerPC code generator, I'm free to ask for advice, experiences, 
  829. etc. from some of the guys at IBM's Watson Research Center where the 
  830. POWER architecture was originally designed. It turns out much of my 
  831. current code generator design is already based on some papers that they 
  832. wrote at Watson anyway. They are willing to be pretty free with their 
  833. experience, but I imagine they will also keep some tricks to themselves.
  834.  
  835. No source code is involved, at least not to my knowledge.
  836.  
  837. [... rest deleted ...]
  838.  
  839.  
  840.  
  841. +++++++++++++++++++++++++++
  842.  
  843. >From zstern@adobe.com (Zalman Stern)
  844. Date: Wed, 27 Apr 1994 21:59:22 GMT
  845. Organization: Adobe Systems Incorporated
  846.  
  847. John McEnerney writes
  848. > This is definitely attributable to the 550 being faster. When 
  849. > optimizations are turned off, CodeWarrior handily outperforms xlc (xlc 
  850. > makes little use of registers when optimization is turned off)
  851.  
  852. I've observed that if you have debugging information turned on and  
  853. optimization turned off, xlc goes out of its way to generate *exactly* the  
  854. seqeunce of operations you wrote in your program. This means that variables  
  855. are "homed" to their memory locations at the end of each line of code if  
  856. they are modified. Variables also seem to be preserved as live to the end of  
  857. their declared scope. The result of these things is a rather inefficient but  
  858. easy to debug program. I never compile with both optimization and debug  
  859. symbols off so I don't know if this is a property of turning optimization  
  860. off, or a property of turning debugging on with optimization off.
  861. --
  862. Zalman Stern           zalman@adobe.com            (415) 962 3824
  863. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  864.           There is no lust like the present.
  865.  
  866. +++++++++++++++++++++++++++
  867.  
  868. >From whitney@galileo.Meakins.McGill.CA ()
  869. Date: Thu, 28 Apr 1994 02:40:14 GMT
  870. Organization: McGill University
  871.  
  872. andys@nsrvan.van.wa.us wrote:
  873. : I ran the FFT benchmark which was posted to comp.sys.powerpc by
  874. : whitney@galileo.Meakins.McGill.CA. I ran this on several computers
  875. : including a PowerMac 6100/60.
  876.  
  877. : I think this is very interesting because it tells me that the
  878. : CodeWarrior optimizer has a LONG way to go. 
  879.  
  880. I have also draw this conclusion, but this well known.
  881. One has be careful on what conclusions one draws from this simple
  882. benchmark. My intention was to use it as sanity check against
  883. the numbers I have in magazines and on the net. The benchmark
  884. was intended to simulate the number crunching efforts of researchers
  885. in our respiratory research lab. We have data sets that usually
  886. larger than most caches so I included that in my benchmark. Those
  887. that takes benchmarks seriously would say that this makes the benchmark
  888. meaningless and that it does little more than detect the presence
  889. or absence of a 512 K cache. ( Perhaps it is the case that all our
  890. research efforts amount to little more than detecting 512K caches :-) )
  891. Of course, running code in a memory bound fashion tends to diminish the 
  892. advantage of the super-scalar designs particularly more sophisticated
  893. designs such as the POWER2 machines ( as seen the benchmarks ).
  894.  
  895. Furthermore the fft implementation is a very simple one. It has
  896. not been reworked for data that exceeds the cache size. Again 
  897. this was deliberate on my part. More often than not we use simple
  898. coding techniques. 
  899.  
  900. : One more note, when I say optimizations above I meant I turned on
  901. : the highest level of optimization each compiler has.
  902.  
  903. I used cc -O only because we may move binaries from
  904. machine to machine - perhaps from the RS6000 to the PowerMac.
  905.  
  906. Whitney
  907.  
  908. +++++++++++++++++++++++++++
  909.  
  910. >From 103t_english@west.cscwc.pima.edu
  911. Date: 27 Apr 94 23:06:02 MST
  912. Organization: (none)
  913.  
  914. In article <A9E32DE57E0104A7@taz.claremont.edu>, Tigger <greg@pomona.claremont.edu> writes:
  915. > In article <2pkaf1$jo5@tornews.torolab.ibm.com> Ian R. Ameline,
  916. > ameline@provence.torolab.ibm.com writes:
  917. >>
  918. >>    I've heard an unconfirmed rumour on the net that they've licenced 
  919. >> some IBM optimization technology.
  920. > I read it in at least two different trade rags, and it was reported
  921. > as news, not rumors.  I believe one of the articles included quotes
  922. > from a higher-up at Metrowerks.  Sounds like more than a rumor to me.
  923. > --
  924. > |  Greg Orman                         greg@pomona.claremont.edu  |
  925. > |     A man's best friends:  a Harley, a Beretta and a Gund.     |
  926.  
  927.  
  928.  
  929. On AOL, the architect of the CodeWarrior C/C++ came out and clarified issues.
  930. He won't be able to do much until next year at the earliest...
  931.  
  932. Lawson
  933.  
  934. +++++++++++++++++++++++++++
  935.  
  936. >From johnmce@world.std.com (John McEnerney)
  937. Date: Thu, 28 Apr 1994 06:24:57 GMT
  938. Organization: The World Public Access UNIX, Brookline, MA
  939.  
  940. usenet@lowry.eche.ualberta.ca (Brian Lowry) writes:
  941.  
  942. >  I was under the impression that the DR2 CodeWarrior C compiler did not
  943. >actually have optimization implemented, regardless of the project settings.
  944. > You might want to contact MetroWerks and ask them.  I haven't seen any
  945. >evidence of optimization in low-level stuff...
  946.  
  947. The DR2 and DR3 versions of CodeWarrior (for PowerPC) have no real 
  948. optimizations. I use the Global Optimization option as a catch-all for 
  949. anything that is likely to slow down the compiler. For now, it only 
  950. controls global register allocation. This does quite a nice job of 
  951. cleaning up your register usage (for example, variables with disjoint 
  952. lifetimes will get the same register, and it does a pretty good job with 
  953. function calls) but usually does not provide a significant performance 
  954. increase because there are so many registers on the PowerPC.
  955.  
  956. Although this is not a huge optimization, the algorithm is O(N^2) so it 
  957. tends to slow the compiler down quite a bit, which is why the smart 
  958. register allocator isn't used all the time.
  959.  
  960. DR4 will probably add some common subexpression elimination.
  961.  
  962. Future versions will add the traditional global optimizations, which will 
  963. slow down the compiler quite a bit more when they are enabled.
  964.  
  965. -- John McEnerney, Metrowerks PowerPC Product Architect
  966.  
  967.  
  968. ---------------------------
  969.  
  970. >From rjc@crosfield.co.uk (Roger Clark)
  971. Subject: How do I find the window colour ???
  972. Date: Thu, 28 Apr 1994 11:05:40 GMT
  973. Organization: Crosfield, Hemel Hempstead, UK
  974.  
  975. Hi,
  976.    I'm trying to find out what "Window colour" has been set by the "Colour" 
  977. control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  978. an attempt to get the "default" window information, but this gives colours
  979. of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  980. components (like content,frame,text,highlight and title bar).
  981.  
  982. Does anyone know what I'm doing wrong, or have a better solution.
  983.  
  984.  
  985. Thanks in advance.
  986.             Roger Clark.
  987.  
  988. +++++++++++++++++++++++++++
  989.  
  990. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  991. Date: Thu, 28 Apr 94 17:10:45 GMT
  992. Organization: National Renewable Energy Laboratory
  993.  
  994. In article <1994Apr28.110540.5738@crosfield.co.uk> Roger Clark,
  995. rjc@crosfield.co.uk writes:
  996. >   I'm trying to find out what "Window colour" has been set by the
  997. "Colour" 
  998. >control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  999. >an attempt to get the "default" window information, but this gives
  1000. colours
  1001. >of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  1002. >components (like content,frame,text,highlight and title bar).
  1003.  
  1004. Two items on ftp.apple.com should give you the information you require:
  1005.  
  1006.   *  Tech Note TB 33 - "Color, Windows and 7.0"
  1007.   *  DTS code snippet "WDEFColorSample"
  1008.  
  1009. +++++++++++++++++++++++++++
  1010.  
  1011. >From devon_hubbard@taligent.com (Devon Hubbard)
  1012. Date: Thu, 28 Apr 1994 17:32:40 GMT
  1013. Organization: Taligent, Inc.
  1014.  
  1015. In article <1994Apr28.110540.5738@crosfield.co.uk>, rjc@crosfield.co.uk
  1016. (Roger Clark) wrote:
  1017.  
  1018. > Hi,
  1019. >    I'm trying to find out what "Window colour" has been set by the "Colour" 
  1020. > control panel.  I have tried using GetAuxWin(nil,&theAuxWinHandle); in
  1021. > an attempt to get the "default" window information, but this gives colours
  1022. > of black or white (0xffff,0xffff,0xffff or 0x0,0x0,0x0) for the various
  1023. > components (like content,frame,text,highlight and title bar).
  1024. > Does anyone know what I'm doing wrong, or have a better solution.
  1025. > Thanks in advance.
  1026. >             Roger Clark.
  1027.  
  1028. Have you seen Infinity Windoid yet?  He supports the floating window being
  1029. the color that the system has assigned and, giving full credit here to Troy
  1030. Gaul, here's how he does it.
  1031.  
  1032. - ---
  1033. static void 
  1034. GetWctbColor(WindowPeek window, short partCode, RGBColor *theColor) {
  1035.     //    Given a partCode, return the RGBColor associated with it. (Using the
  1036.     //    default window color table.)
  1037.     AuxWinHandle awHndl;
  1038.     short count;
  1039.     
  1040.     //    Get the Color table for the window if it has one.
  1041.  
  1042.     (void) GetAuxWin((WindowPtr) window, &awHndl); 
  1043.     count = (**(WCTabHandle) ((**awHndl).awCTable)).ctSize;
  1044.     
  1045.  
  1046.     //    If the table didn't contain the entry of interest, look to the 
  1047.     //    default table.
  1048.     
  1049.     if (count < partCode) {
  1050.         GetAuxWin(nil, &awHndl); 
  1051.         count = (**(WCTabHandle) ((**awHndl).awCTable)).ctSize;
  1052.     }
  1053.             
  1054.  
  1055.     //    If the entry is there, use it, if not make a best guess at a default
  1056. value.
  1057.  
  1058.     if (count < partCode)
  1059.         UseDefaultColor(partCode, theColor);
  1060.     else
  1061.         *theColor = (**(WCTabHandle)
  1062. ((**awHndl).awCTable)).ctTable[partCode].rgb;
  1063. }
  1064. - ----
  1065.  
  1066. You might want to get his cool Infinity Windoid archive from your nearest
  1067. site so you can see everything he's doing.
  1068.  
  1069. - ------------------------------------------------------------------------
  1070. Devon Hubbard                                                Silicon Pilot
  1071. devon_hubbard@taligent.com                                   Taligent, Inc
  1072.  
  1073. ---------------------------
  1074.  
  1075. >From tonym@netcom.com (Tony Mann)
  1076. Subject: Private inheritance faulty in SC++ 7.0
  1077. Date: Wed, 27 Apr 1994 21:58:51 GMT
  1078. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1079.  
  1080. Using SC++ 7.0, the following code should not compile, but it does:
  1081.  
  1082. class Bag
  1083. {
  1084. public:
  1085.   Bag();
  1086.   int GetCount() { return count; }
  1087. private:
  1088.   int count;
  1089. };
  1090.  
  1091. class Set: private Bag  // note "private" keyword
  1092. {
  1093. public:
  1094.   Set();
  1095. };
  1096.  
  1097. int foo(Bag& b)
  1098. {
  1099.   return b.GetCount();
  1100. }
  1101.  
  1102. main()
  1103. {
  1104.   Bag *b = new Set;     // ** should generate error; it does not
  1105.   Set s;
  1106.   foo(s);               // ** should generate error; it does not
  1107.   return 0;
  1108. }
  1109.  
  1110. The compiler is allowing a Set to be implicitly converted to a Bag;
  1111. this should not be allowed, since Set privately inherits from Bag.
  1112.  
  1113. Symantec has been notified.
  1114.  
  1115. - Tony Mann
  1116.  
  1117. ---------------------------
  1118.  
  1119. >From David Plumpton <plumpto@bnr.ca>
  1120. Subject: Source Control Questions
  1121. Date: Tue, 19 Apr 1994 03:12:09 GMT
  1122. Organization: NorTel
  1123.  
  1124. Are there any real alternatives to using MPW projector?
  1125. If you had to manage a multiplatform project using Macintosh,
  1126. Unix and Windows, which source control system on which
  1127. platform would you choose?
  1128.  
  1129. Thanks in advance.
  1130. - -----------
  1131. David Plumpton: plumpto@bnr.ca
  1132. "I'm a New Zealand Zoo Official, and this monkey's going to Newton!"
  1133.  
  1134. +++++++++++++++++++++++++++
  1135.  
  1136. >From rgc3679@halcyon.halcyon.com (Bob Carpenter)
  1137. Date: 20 Apr 1994 19:42:23 GMT
  1138. Organization: A World of Information at Your Fingertips
  1139.  
  1140. In article <1994Apr19.031209.7354@bnr.ca>,
  1141. David Plumpton  <plumpto@bnr.ca> wrote:
  1142. >Are there any real alternatives to using MPW projector?
  1143. >If you had to manage a multiplatform project using Macintosh,
  1144. >Unix and Windows, which source control system on which
  1145. >platform would you choose?
  1146. >
  1147.  
  1148.  I'd use SCCS under Unix. It's fairly powerful, and with scripts
  1149.  you can tailor it to your liking.
  1150.  
  1151.  See the sccs man pages for the details.
  1152.  
  1153. --BobC
  1154.  
  1155. +++++++++++++++++++++++++++
  1156.  
  1157. >From sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  1158. Date: Thu, 21 Apr 94 09:52:55 GMT
  1159. Organization: Network Analysis Ltd
  1160.  
  1161.  
  1162. In article <2p40iv$d1f@nwfocus.wa.com> (comp.sys.mac.programmer), rgc3679@halcyon.halcyon.com (Bob Carpenter) writes:
  1163. > In article <1994Apr19.031209.7354@bnr.ca>,
  1164. > David Plumpton  <plumpto@bnr.ca> wrote:
  1165. > >Are there any real alternatives to using MPW projector?
  1166. > >If you had to manage a multiplatform project using Macintosh,
  1167. > >Unix and Windows, which source control system on which
  1168. > >platform would you choose?
  1169. > >
  1170. >  I'd use SCCS under Unix. It's fairly powerful, and with scripts
  1171. >  you can tailor it to your liking.
  1172.  
  1173. You cannot be serious: the contortions you have to go through just to
  1174. mark a set of versions as belonging to a particular release! (Yes, I
  1175. know about the
  1176.  
  1177.     what prog > prog.slist
  1178.  
  1179. trick :-()
  1180.  
  1181. Anyway, I've just come off a Windows/Mac project straight into another one, so
  1182. the issue is very much on my mind. The main problems with using a non-Mac source
  1183. control system are
  1184.  
  1185. a) filename lengths
  1186.  
  1187. For the first project, we used PVCS on a PC-compatible. Using LAN Mgr for
  1188. the Mac, we mounted the PC vols on the Mac desktop, and saved our src files
  1189. there. We then hopped on to a PC to check stuff in and out. Even though LAN
  1190. Mgr lets you use full Mac filenames, when we came to use PVCS we discovered
  1191. very quickly that we had to use 8.3 filenames. That meant chasing through
  1192. all our makefiles, .r files &c - bugs from which are still haunting me (some
  1193. of the files, like .r files only get rebuilt very occasionally).
  1194.  
  1195. b) they destroy the Mac rez fork
  1196.  
  1197. I knew that we couldn't save rsrc files in PVCS, so I had a couple of small
  1198. MPW scripts that derez'ed rsrc files before saving them on the PC volume.
  1199. Well, that worked, but we then found that when we checked stuff back out of
  1200. PVCS that we had lost all our tab settings, font settings, and most important,
  1201. our MPW markers in every source file. (Sound of grinding teeth...)
  1202.  
  1203. My current project uses SCCS, and we are going to have similar problems.
  1204. Anyway, the last time this subject came up, Tom Emerson of Symantec pointed
  1205. me at
  1206.  
  1207.       SourceSafe by
  1208.           OneTree Software
  1209.           P.O. Box 11639
  1210.           Raleigh, NC 27604
  1211.           USA
  1212.  
  1213.           (919)-821-2300
  1214.           fax (919)-821-5222
  1215.  
  1216. I didn't get a chance to follow this up, though I will do this time (promise,
  1217. really, honest :-).
  1218.  
  1219. Another possiblility you might like to look at is RCS - there is a Mac port
  1220. by Tim Endres, available from nic.switch.ch or ftp.msen.com (in /pub/vendors/ice).
  1221. Please report any experiences with this, especially if you've used it on a
  1222. real project.
  1223.  
  1224. Actually, I quite like Projector, especially when backed up with suitable MPW
  1225. scripts (look for DTS Goodies on a developer CD). I don't see why it can't
  1226. be used for storing Unix and Windows src files, since Projector, unlike SCCS
  1227. can hold binary files.
  1228.  
  1229.  
  1230. Sak Wathanasin
  1231. Network Analysis Limited
  1232. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  1233.  
  1234. Internet: sw@network-analysis-ltd.co.uk 
  1235. uucp:     ...!uknet!nan!sw                       AppleLink: NAN.LTD
  1236. Phone: (+44) 203 419996 Mobile:(+44) 850 587411  Fax: (+44) 203 690690
  1237.  
  1238. +++++++++++++++++++++++++++
  1239.  
  1240. >From xxx (Christoph Reichenberger)
  1241. Date: Mon, 25 Apr 1994 07:10:27 GMT
  1242. Organization: Uni Software Plus
  1243.  
  1244. In article <2p40iv$d1f@nwfocus.wa.com>, rgc3679@halcyon.halcyon.com (Bob
  1245. Carpenter) wrote:
  1246.  
  1247. > In article <1994Apr19.031209.7354@bnr.ca>,
  1248. > David Plumpton  <plumpto@bnr.ca> wrote:
  1249. > >Are there any real alternatives to using MPW projector?
  1250. > >If you had to manage a multiplatform project using Macintosh,
  1251. > >Unix and Windows, which source control system on which
  1252. > >platform would you choose?
  1253. > >
  1254.  
  1255. Voodoo (the name stands for Versions Of Outdated Documents Organized
  1256. Orthogonally) is a (Mac) version management tool for the simple and clear
  1257. management of projects in which files are created in numerous versions
  1258. (variants and revisions). Since Voodoo is capable of managing
  1259. arbitrary files, the program can be employed for more than just the
  1260. organization of software projects in a narrow sense (program
  1261. development). Even the writing of a book, for example, is a project in
  1262. which multiple elementary building blocks (the individual chapters,
  1263. illustrations, etc.) evolve in various revisions. Using Voodoo can
  1264. also pay off here.
  1265.  
  1266. Voodoo allows both variant and revision control, and it
  1267. manages not only variants and revisions of single files, but
  1268. of a whole software project (multi files, multi users,
  1269. multi variants, access rights, ...).
  1270.  
  1271. The tool offers a neat graphical user interface and is not only
  1272. suitable for mere source code control but can handle all
  1273. different kinds of files with amazing compression rates:
  1274.  
  1275.           typical size of delta between arbitrary files
  1276.                5% (in words:  five per cent)  !!!!
  1277.  
  1278. no matter whether the files are plain text or any other
  1279. documents - e. g. MSWord, WriteNow, Canvas, FileMaker ...).
  1280. Contrary, if you try to manage non-text-files with Projector
  1281. or SCCS you will not get any space reduction.
  1282.  
  1283. Voodoo differs from previous source code control systems in its
  1284. orthogonal approach to version management. This means that for
  1285. every component of a project hierarchy you can not only store
  1286. its revision history but also different variants of the same
  1287. component.The orthogonal organization of revisions and
  1288. variants leads to a much clearer organization that with other
  1289. RCS/SCCS-based tools like Projector/SourceServer and others.
  1290.  
  1291. A lite version of Voodoo is being distributed on a shareware basis (30 $).
  1292. The package included contains VoodooLite 1.5 together with a
  1293. readme document and a manual.
  1294.  
  1295. You can get the current version directly from our ftp-server at:
  1296.   ftp.swe.uni-linz.ac.at    in /pub/voodoo
  1297.  
  1298. Additionally it should be available via ftp at least at the
  1299. following sites:
  1300.   sumex-aim.stanford.edu    in /info-mac/dev
  1301.   mac.archive.umich.edu     in /mac/util/organization
  1302.  
  1303. The full (commercial) version of Voodoo is being distributed
  1304. world-wide by:
  1305.  
  1306.    UNI Software Plus
  1307.    Softwarepark Hagenberg
  1308.    A-4232 Hagenberg
  1309.    AUSTRIA (Europe)
  1310.    Fax.: +43 (7236) 37 69
  1311.    EMail: voodoo@unisoft.co.at
  1312.  
  1313. For further information on Voodoo Lite or on the full version
  1314. please contact the author:
  1315.  
  1316.     Christoph Reichenberger      Tel:      +43-7262-2166
  1317.                  Erlenweg 2      Fax:      +43-7236-3338-30
  1318.        A-4320 Perg, Austria      Internet: chrei@unisoft.co.at
  1319.                                                                                     
  1320.  
  1321. Feel free to contact me, if you have further questions concerning Voodoo.
  1322.  
  1323. Christoph, the author of Voodoo
  1324.  
  1325.  
  1326. +++++++++++++++++++++++++++
  1327.  
  1328. >From hoshi@sra.co.jp (Hoshi Takanori)
  1329. Date: 27 Apr 94 11:34:50
  1330. Organization: Software Research Associates, Inc.,Japan
  1331.  
  1332. In article <1994Apr19.031209.7354@bnr.ca> David Plumpton <plumpto@bnr.ca> writes:
  1333.  
  1334. > Are there any real alternatives to using MPW projector?
  1335. > If you had to manage a multiplatform project using Macintosh,
  1336. > Unix and Windows, which source control system on which
  1337. > platform would you choose?
  1338.  
  1339. I've just started using RCS on my MacMiNT.  It's great!
  1340.  
  1341. hoshi
  1342.  
  1343. ---------------------------
  1344.  
  1345. >From Ken Prehoda <kenp@nmrfam.wisc.edu>
  1346. Subject: Using xlc to generate PowerMacintosh code
  1347. Date: 15 Apr 1994 00:36:24 GMT
  1348. Organization: Univ of Wisc-Madison
  1349.  
  1350. I have access to an RS/6000 with the xlc compiler.  My
  1351. question is how do I use this compiler to generate
  1352. code for the mac.  Could someone with experience in
  1353. this area please give me some pointers?
  1354.  
  1355. Thanks,
  1356. Ken Prehoda
  1357. kenp@nmrfam.wisc.edu
  1358.  
  1359. +++++++++++++++++++++++++++
  1360.  
  1361. >From creiman@netcom.com (Charlie Reiman)
  1362. Date: Fri, 15 Apr 1994 07:15:24 GMT
  1363. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1364.  
  1365. Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1366.  
  1367. >I have access to an RS/6000 with the xlc compiler.  My
  1368. >question is how do I use this compiler to generate
  1369. >code for the mac.  Could someone with experience in
  1370. >this area please give me some pointers?
  1371.  
  1372. You can't, really. The xlc that apple is giving to developers is
  1373. modified to support the pascal keyword (ignored), #pragma align=68k
  1374. (very important), and pascal strings (also important). Also, their xlc
  1375. generates instructions for the PowerPC which probably isn't an option
  1376. on older versions of xlc.
  1377.  
  1378. If you don't need any of these, then you can generate .o files, then
  1379. drop those into an MPW development environment and use the usual
  1380. makepef, ppclink, et al. If you can get the inside track SDK, it's
  1381. actually pretty cool (if you are an unix hacker, anyway).  I've
  1382. always wanted to cross compile my mac apps under unix. Now, I can.
  1383.  
  1384. -- 
  1385. "You can't cancel the project! We already made the T-shirts!"
  1386. Charlie Reiman
  1387. creiman@netcom.com
  1388.  
  1389. +++++++++++++++++++++++++++
  1390.  
  1391. >From mgleason@cse.unl.edu (Mike Gleason)
  1392. Date: 15 Apr 1994 11:13:39 GMT
  1393. Organization: NCEMRSoft
  1394.  
  1395. creiman@netcom.com (Charlie Reiman) writes:
  1396.  
  1397. |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1398. |>I have access to an RS/6000 with the xlc compiler. My question is how
  1399. |>do I use this compiler to generate code for the mac. Could someone with
  1400. |>experience in this area please give me some pointers?
  1401.  
  1402. |You can't, really. The xlc that apple is giving to developers is
  1403. |modified to support the pascal keyword (ignored), #pragma align=68k
  1404. |(very important), and pascal strings (also important). Also, their xlc
  1405. |generates instructions for the PowerPC which probably isn't an option
  1406. |on older versions of xlc.
  1407.  
  1408. Too bad... one could write a preprocessor that could handle the 'pascal'
  1409. and pascal strings, then use that before the cpp for xlc.  Can't get
  1410. around the #pragma align=68k or PowerPC generation, though.
  1411.  
  1412. |If you don't need any of these, then you can generate .o files, then
  1413. |drop those into an MPW development environment and use the usual
  1414. |makepef, ppclink, et al. If you can get the inside track SDK, it's
  1415. |actually pretty cool (if you are an unix hacker, anyway).  I've
  1416. |always wanted to cross compile my mac apps under unix. Now, I can.
  1417.  
  1418. Me too.  One thing I did just figure out how to do, which has nothing
  1419. to do with PowerPC, is send my mac code over to a unix box and run
  1420. lint on it, or actually "compile" my mac code with gcc for sole purpose
  1421. of seeing all the cool warnings it spews.  Seems kind of silly, but
  1422. the only mac compiler I can use right now is Think C 5, which doesn't
  1423. give me warning messages.
  1424.  
  1425. --
  1426. --mg                                                      mgleason@cse.unl.edu
  1427.  
  1428. +++++++++++++++++++++++++++
  1429.  
  1430. >From Ken Prehoda <kenp@nmrfam.wisc.edu>
  1431. Date: 15 Apr 1994 14:58:51 GMT
  1432. Organization: Univ of Wisc-Madison
  1433.  
  1434. <creimanCoAHHp.C90@netcom.com> Charlie Reiman, creiman@netcom.com writes:
  1435. >You can't, really. The xlc that apple is giving to developers is
  1436. >modified to support the pascal keyword (ignored), #pragma align=68k
  1437. >(very important), and pascal strings (also important). Also, their xlc
  1438. >generates instructions for the PowerPC which probably isn't an option
  1439. >on older versions of xlc.
  1440.  
  1441. Thanks for the info.  The version of xlc that I have will 
  1442. align=68k and will also generate instructions for the 601.
  1443. Also, I can get rid of the pascal keyword easy enough.  
  1444. In other words, I think I can get it to do all of the things
  1445. that you say.  However, is it possible to compile a complete
  1446. mac application on the RS/6000 (i.e. I don't have MPW)?
  1447.  
  1448.  
  1449. >If you don't need any of these, then you can generate .o files, then
  1450. >drop those into an MPW development environment and use the usual
  1451. >makepef, ppclink, et al. If you can get the inside track SDK, it's
  1452. >actually pretty cool (if you are an unix hacker, anyway).  I've
  1453. >always wanted to cross compile my mac apps under unix. Now, I can.
  1454.  
  1455. Me too.  And that's the main reason I'm even bothering with all this.
  1456. Not to mention how much I like xlc.
  1457.  
  1458. Thanks again,
  1459. Ken Prehoda
  1460. kenp@nmrfam.wisc.edu
  1461.  
  1462. +++++++++++++++++++++++++++
  1463.  
  1464. >From proth@toto.cs.uiuc.edu (Phil Roth)
  1465. Date: Fri, 15 Apr 1994 16:10:22 GMT
  1466. Organization: Picasso Group, DCS, University of Illinois, Urbana-Champaign
  1467.  
  1468. In article <2olst3$9oi@crcnis1.unl.edu>, mgleason@cse.unl.edu (Mike Gleason) writes:
  1469. |> creiman@netcom.com (Charlie Reiman) writes:
  1470. |> 
  1471. |> |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1472. |> |>I have access to an RS/6000 with the xlc compiler. My question is how
  1473. |> |>do I use this compiler to generate code for the mac. Could someone with
  1474. |> |>experience in this area please give me some pointers?
  1475. |> 
  1476. |> |You can't, really. The xlc that apple is giving to developers is
  1477. |> |modified to support the pascal keyword (ignored), #pragma align=68k
  1478. |> |(very important), and pascal strings (also important). Also, their xlc
  1479. |> |generates instructions for the PowerPC which probably isn't an option
  1480. |> |on older versions of xlc.
  1481. |> 
  1482. |> Too bad... one could write a preprocessor that could handle the 'pascal'
  1483. |> and pascal strings, then use that before the cpp for xlc.  Can't get
  1484. |> around the #pragma align=68k or PowerPC generation, though.
  1485.  
  1486.  
  1487. The last version of xlc I installed on our research RS/6000 supposedly
  1488. has PowerPC code generation support ( using -qarch=ppc ).
  1489. The man page claims that it will
  1490.  
  1491.     "Produce an object that contains instructions that will
  1492.     run on any of the 32-bit PowerPC hardware platforms."
  1493.  
  1494. Also, one can specify an alignment option for aligning structs and unions.
  1495. The choices are 'power' for the POWER architecture, 'twobyte' for two
  1496. byte alignment, and 'packed' for one byte alignment.
  1497. How would this relate to the 'align=68k' pragma discussed above?
  1498.  
  1499. Pascal strings would be an interesting addition, nevertheless.
  1500.  
  1501. Phil Roth
  1502. proth@cs.uiuc.edu
  1503.  
  1504.  
  1505. +++++++++++++++++++++++++++
  1506.  
  1507. >From zstern@adobe.com (Zalman Stern)
  1508. Date: Fri, 15 Apr 1994 10:15:09 GMT
  1509. Organization: Adobe Systems Incorporated
  1510.  
  1511. Ken Prehoda <kenp@nmrfam.wisc.edu> writes
  1512. > I have access to an RS/6000 with the xlc compiler.  My
  1513. > question is how do I use this compiler to generate
  1514. > code for the mac.  Could someone with experience in
  1515. > this area please give me some pointers?
  1516.  
  1517. Both Metrowerks and Apple's Macintosh on RISC SDK will accept XCOFF object  
  1518. files from the RS/6000. And if you have the very latest version of IBM's  
  1519. compilers, you should be able to compile with the Universal headers. (I  
  1520. believe Charlie Reiman's comment that the Mac specific features are not in  
  1521. the shipping version of IBM's compiler is incorrect.) You'll likely need to  
  1522. muck with the xlc configuration though. You can either do this by hand  
  1523. feeding in a bunch of flags on the command line, or by making a custom  
  1524. xlc.cfg file. (Which is only slightly more fun than smacking yourself in the  
  1525. head with an axe repeatedly.) The important compiler options you'll need  
  1526. are:
  1527.  
  1528. -qmacpstr -qpascal -qenum=small -qcpluscmt -qldbl128 -qchars=signed  
  1529. -D__powerc=1 -Dpowerc=1 -DUSE68KINLINES=0 -U_AIX
  1530.  
  1531. You'll need a -I directive pointing to the Universal headers somewhere on  
  1532. your AIX box. (Unless the code doesn't rely on Macintosh interfaces in which  
  1533. case its a lot easier. For example if you just have some computation  
  1534. intensive routines you want to compile.) You might also want to add a  
  1535. -qNOSTDINC to tell xlc not to search the standard system include  
  1536. directories.
  1537.  
  1538. You can link on the AIX box as well if you have the right libraries, which  
  1539. can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1540. result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1541. haul the .o files over to your Mac (being sure to use a binary transfer  
  1542. method that preserves every last bit in its pristine natural form) and use  
  1543. Apple's PowerPC linker within MPW. (I've never used Apple's SDK, so I really  
  1544. have no idea how that works.) Once you've gotten a fully linked XCOFF file,  
  1545. you can feed it to makepef to produce your PEF container. (And you'll have  
  1546. to do that in MPW 'cause I doubt Apple is distributing the RS/6000 version  
  1547. of makepef anywhere.)
  1548.  
  1549. I'll let John McEnerney detail how you use AIX generated objects with  
  1550. CodeWarrior. So far I've figured out that you need a file of type XCOF and  
  1551. creator UNIX which is a shared reuseable XCOFF library. I believe this  
  1552. implies that CodeWarrior will only link against shared libraries this way,  
  1553. that you can't link the code directly into your app. (Then again I really  
  1554. have no idea how it works.) If that's true, you'll need to make a shared  
  1555. library out of the code you compile on AIX. (The specific process of making  
  1556. a shared library is a a bit involved, but on AIX, you'll need to give ld at  
  1557. least the -bM:SRE switch and an exports file. You feed the output of that to  
  1558. makepef and shove a cfrg resource in the resource fork of the result.)
  1559.  
  1560. Suffice it to say, this is not a trivial task. Though realistically, it is  
  1561. probably the best development environment for Power Macintosh right now.  
  1562. Especially if you have a really huge app, or are working in C++.
  1563. --
  1564. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1565. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1566. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1567.  
  1568. +++++++++++++++++++++++++++
  1569.  
  1570. >From zstern@adobe.com (Zalman Stern)
  1571. Date: Sat, 16 Apr 1994 01:31:01 GMT
  1572. Organization: Adobe Systems Incorporated
  1573.  
  1574. Phil Roth writes
  1575. > In article <2olst3$9oi@crcnis1.unl.edu>, mgleason@cse.unl.edu (Mike  
  1576. Gleason) writes:
  1577. > |> creiman@netcom.com (Charlie Reiman) writes:
  1578. > |> 
  1579. > |> |Ken Prehoda <kenp@nmrfam.wisc.edu> writes:
  1580. > |> |>I have access to an RS/6000 with the xlc compiler. My question is how
  1581. > |> |>do I use this compiler to generate code for the mac. Could someone  
  1582. with
  1583. > |> |>experience in this area please give me some pointers?
  1584. > |> 
  1585. > |> |You can't, really. The xlc that apple is giving to developers is
  1586. > |> |modified to support the pascal keyword (ignored), #pragma align=68k
  1587. > |> |(very important), and pascal strings (also important). Also, their xlc
  1588. > |> |generates instructions for the PowerPC which probably isn't an option
  1589. > |> |on older versions of xlc.
  1590. > |> 
  1591. > |> Too bad... one could write a preprocessor that could handle the  
  1592. 'pascal'
  1593. > |> and pascal strings, then use that before the cpp for xlc.  Can't get
  1594. > |> around the #pragma align=68k or PowerPC generation, though.
  1595. > The last version of xlc I installed on our research RS/6000 supposedly
  1596. > has PowerPC code generation support ( using -qarch=ppc ).
  1597. > The man page claims that it will
  1598. >     "Produce an object that contains instructions that will
  1599. >     run on any of the 32-bit PowerPC hardware platforms."
  1600. > Also, one can specify an alignment option for aligning structs and unions.
  1601. > The choices are 'power' for the POWER architecture, 'twobyte' for two
  1602. > byte alignment, and 'packed' for one byte alignment.
  1603. > How would this relate to the 'align=68k' pragma discussed above?
  1604.  
  1605. "#pragma options align=mac68k" is a synonym for "#pragma options  
  1606. align=twobyte". Try using the mac68k syntax with the shipping 1.03 version  
  1607. of xlc and I bet it will work. By the way, I left out the "-qarch=ppc"  
  1608. switch in my previous message in this thread. You should give that to xlc to  
  1609. prevent it from generating POWER architecture only instructions.
  1610. --
  1611. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1612. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1613. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1614.  
  1615. +++++++++++++++++++++++++++
  1616.  
  1617. >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte)
  1618. Date: 16 Apr 1994 09:39:13 GMT
  1619. Organization: The Royal Institute of Technology
  1620.  
  1621. In <1994Apr15.101509.21634@adobe.com> zstern@adobe.com (Zalman Stern) writes:
  1622.  
  1623. >You can link on the AIX box as well if you have the right libraries, which  
  1624. >can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1625. >result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1626.  
  1627. Actually, you CAN execute an XCOFF as well (I haven't tried but heard
  1628. it from an engineer who should know) It's just that they're 3 times the
  1629. size of a PEF...
  1630.  
  1631. -- 
  1632.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1633.  "If people bought cars according to the same principles they buy computers,
  1634.   cars would behave like Lamborghinis but would be built and look like Yugos."
  1635.                      -- Craig Fields
  1636.  
  1637. +++++++++++++++++++++++++++
  1638.  
  1639. >From creiman@netcom.com (Charlie Reiman)
  1640. Date: Mon, 18 Apr 1994 02:53:13 GMT
  1641. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1642.  
  1643. d88-jwa@mumrik.nada.kth.se (Jon Wdtte) writes:
  1644.  
  1645. >In <1994Apr15.101509.21634@adobe.com> zstern@adobe.com (Zalman Stern) writes:
  1646.  
  1647. >>You can link on the AIX box as well if you have the right libraries, which  
  1648. >>can probably be snagged off Apple's SDK. You'll have to move the XCOFF  
  1649. >>result over to a Mac and run makepef in MPW. Optionally, it may be easier to  
  1650.  
  1651. >Actually, you CAN execute an XCOFF as well (I haven't tried but heard
  1652. >it from an engineer who should know) It's just that they're 3 times the
  1653. >size of a PEF...
  1654.  
  1655. 3??? Try 40 times larger. I have a 2 meg pef that I makepef from an xcoff
  1656. that is 70-80megs. 
  1657.  
  1658. Yes, linking takes forever.
  1659.  
  1660. -- 
  1661. "You can't cancel the project! We already made the T-shirts!"
  1662. Charlie Reiman
  1663. creiman@netcom.com
  1664.  
  1665. +++++++++++++++++++++++++++
  1666.  
  1667. >From zstern@adobe.com (Zalman Stern)
  1668. Date: Mon, 18 Apr 1994 04:16:26 GMT
  1669. Organization: Adobe Systems Incorporated
  1670.  
  1671. Charlie Reiman writes
  1672. [XCOFF vs. PEF.]
  1673. > 3??? Try 40 times larger. I have a 2 meg pef that I makepef from an xcoff
  1674. > that is 70-80megs. 
  1675. > Yes, linking takes forever.
  1676.  
  1677. You build with full debug symbols right? XCOFF is a pig, but not that much  
  1678. of a pig. PEF doesn't contain any debug info of course. the .xSYM file for  
  1679. your XCOFF is probably measured in tens of megabytes though.
  1680.  
  1681. Likewise, IBM linker is dramatically faster if you turn off debug info for  
  1682. the compiler. (Unfortunately, there is no switch to the linker to ignore  
  1683. debug info for all but a few object files.) On a pretty hefty RS/6000, I can  
  1684. link in 15 minutes with full symbols and 1 minute with no symbols. I leave  
  1685. in traceback tables (the moral equivalent of Macsbug names) and debug a lot  
  1686. of stuff that way. And at the end of the day, if I'm lucky I manage to club  
  1687. some small mammal on the way back to the cave so I can have dinner :-)
  1688. --
  1689. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1690. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1691. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1692.  
  1693. +++++++++++++++++++++++++++
  1694.  
  1695. >From maynard@elwing.otago.ac.nz (Maynard James Handley)
  1696. Date: Wed, 20 Apr 1994 22:59:21 GMT
  1697. Organization: University of Otago
  1698.  
  1699. Apart from issues like 68K alignment and pascal strings, are there not 
  1700. fundamental problems at the "OS" level?
  1701. For examples, doesn't AIX have conventions about using the first N registers
  1702. to pass variables between functions. I don't know if MacOS on PowerPC has
  1703. such conventions, but it expectects one of the registers always to point
  1704. to the code fragment TOC thingie---would it not be very bad if xlc used
  1705. said register for something else.
  1706.  
  1707. Are these valid issues or not? I don't yet have a copy of IM: RISC system 
  1708. software, so please be gentle if I'm spouting nonsense.
  1709.  
  1710. Maynard Handley
  1711.  
  1712. +++++++++++++++++++++++++++
  1713.  
  1714. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  1715. Date: Thu, 21 Apr 1994 11:22:55 +0800
  1716. Organization: Department of Computer Science, The University of Western Australia
  1717.  
  1718. In article <CoKyIx.I7F@news.otago.ac.nz>, maynard@elwing.otago.ac.nz
  1719. (Maynard James Handley) wrote:
  1720.  
  1721. >Apart from issues like 68K alignment and pascal strings, are there not 
  1722. >fundamental problems at the "OS" level?
  1723. >
  1724. >[lots of talk about calling conventions]
  1725.  
  1726. My understanding is that Apple block-copied IBM's runtime architecture for
  1727. their PowerMacs.  [This is not a criticism, just an observation.  The
  1728. run-time architecture is kinda cool -- apart from the *extreme* silliness
  1729. of allocating two GPRs for each FP parameter just to support
  1730. prototype-less C calling!]
  1731. -- 
  1732. Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
  1733. Department of Computer Science, The University of Western Australia
  1734.  
  1735. +++++++++++++++++++++++++++
  1736.  
  1737. >From zstern@adobe.com (Zalman Stern)
  1738. Date: Thu, 21 Apr 1994 05:53:08 GMT
  1739. Organization: Adobe Systems Incorporated
  1740.  
  1741. Maynard James Handley writes
  1742. > Apart from issues like 68K alignment and pascal strings, are there not 
  1743. > fundamental problems at the "OS" level?
  1744. > For examples, doesn't AIX have conventions about using the first N  
  1745. registers
  1746. > to pass variables between functions. I don't know if MacOS on PowerPC has
  1747. > such conventions, but it expectects one of the registers always to point
  1748. > to the code fragment TOC thingie---would it not be very bad if xlc used
  1749. > said register for something else.
  1750.  
  1751. The runtime architecture you are refering to was developed by IBM and  
  1752. adopted basically without change by Apple. Binaries running on the RS/6000  
  1753. have used r2 as a TOC pointer for more than four years now. (And that  
  1754. particular convention pretty much came from the IBM RT which shipped in  
  1755. '86.) The PowerPC code in the Power Macintosh ROMs is compiled with xlc.
  1756. --
  1757. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1758. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1759. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1760.  
  1761. +++++++++++++++++++++++++++
  1762.  
  1763. >From R.Beloin@cornell.edu (Ron Beloin)
  1764. Date: Thu, 21 Apr 1994 11:57:00 -0500
  1765. Organization: Boyce Thompson Inst. for Plant Research
  1766.  
  1767. In article <1994Apr18.041626.14768@adobe.com>, zstern@adobe.com (Zalman
  1768. Stern) wrote:
  1769. > [XCOFF vs. PEF.]
  1770. > [other stuff about XCOFF]
  1771.  
  1772. Sorry for the basic question, but how does one link XCOFF format
  1773. files from an RS6K in MPW? E.G., what version of Link do i need, what
  1774. options or swithches are required. I already have the RS6K and E.T.O.
  1775. Thanks.
  1776. -- 
  1777. Ron Beloin (R.Beloin@cornell.edu)
  1778. [who works, but doesn't speak, for the]
  1779. Boyce Thompson Inst.
  1780. Ithaca, NY
  1781.  
  1782. +++++++++++++++++++++++++++
  1783.  
  1784. >From zstern@adobe.com (Zalman Stern)
  1785. Date: Thu, 21 Apr 1994 23:31:46 GMT
  1786. Organization: Adobe Systems Incorporated
  1787.  
  1788. Ron Beloin writes
  1789. > In article <1994Apr18.041626.14768@adobe.com>, zstern@adobe.com (Zalman
  1790. > Stern) wrote:
  1791. > > [XCOFF vs. PEF.]
  1792. > > [other stuff about XCOFF]
  1793. > Sorry for the basic question, but how does one link XCOFF format
  1794. > files from an RS6K in MPW? E.G., what version of Link do i need, what
  1795. > options or swithches are required. I already have the RS6K and E.T.O.
  1796. > Thanks.
  1797.  
  1798. You need ppclink off the Macintosh on RISC SDK.
  1799. --
  1800. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1801. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1802. Remember Y'all, in Arizona immigration lawyers are in season year 'round!
  1803.  
  1804. +++++++++++++++++++++++++++
  1805.  
  1806. >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte)
  1807. Date: 23 Apr 1994 10:40:51 GMT
  1808. Organization: The Royal Institute of Technology
  1809.  
  1810. In <R.Beloin-210494115700@theq.cit.cornell.edu> R.Beloin@cornell.edu (Ron Beloin) writes:
  1811.  
  1812. >Sorry for the basic question, but how does one link XCOFF format
  1813. >files from an RS6K in MPW? E.G., what version of Link do i need, what
  1814. >options or swithches are required. I already have the RS6K and E.T.O.
  1815.  
  1816. You need the Mac on RISC SDK CD which comes with PPCLink and
  1817. MakePEF. It also comes with the right headers and libraries.
  1818.  
  1819. Cheers,
  1820. -- 
  1821.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1822.  
  1823.   "Never mistake a clear view for a short distance"
  1824.                      -- Saffo
  1825.  
  1826. +++++++++++++++++++++++++++
  1827.  
  1828. >From Dave Falkenburg <falken@apple.com>
  1829. Date: Thu, 28 Apr 1994 17:03:33 GMT
  1830. Organization: Apple Computer, Inc.
  1831.  
  1832. In article <CoKyIx.I7F@news.otago.ac.nz> Maynard James Handley,
  1833. maynard@elwing.otago.ac.nz writes:
  1834. >For examples, doesn't AIX have conventions about using the first N
  1835. registers
  1836. >to pass variables between functions. I don't know if MacOS on PowerPC has
  1837. >such conventions, but it expectects one of the registers always to point
  1838. >to the code fragment TOC thingie---would it not be very bad if xlc used
  1839. >said register for something else.
  1840.  
  1841. The PowerMac runtime environment is dervied from the AIX runtime model--
  1842. we used special versions of xlc to build the native portions of the
  1843. toolbox.
  1844.  
  1845. -Dave Falkenburg
  1846. -Apple Computer, Inc.
  1847.  
  1848. ---------------------------
  1849.  
  1850. End of C.S.M.P. Digest
  1851. **********************
  1852.  
  1853.  
  1854.